<html>
<head>
    <meta charset="UTF-8">
    <title>测试版下载</title>
</head>
<div class="parent" style="display: flex; flex-direction: column; align-items: center;">
    <img src="512x512.png">
    <a id="download" style="font-size: 60px;">点我下载App</a>
    <a id="config" style="font-size: 30px;">xxx</a>
</div>

<script>

    var patharr = window.location.href.split("/");
    patharr[patharr.length-1] = "manifest.plist";
    manifest_path = patharr.join("/"); //manifest 路径地址

    appurl_prefix = "itms-services:///?action=download-manifest&url="; //apple 前缀地址
    var linkUrl = appurl_prefix + manifest_path;  //跳转地址 = 前缀 + manifest下载地址

    console.log(linkUrl);

    //自动点击
    var link = document.getElementById('download');
    link.setAttribute("href",linkUrl);
    link.click();


    //其他参数配置：
    var configTXT = loadFile('./config.txt');
    var configNode = document.getElementById('config');
    configNode.text = configTXT;


    function loadFile(filePath) {
      var result = null;
      var xmlhttp = new XMLHttpRequest();
      xmlhttp.open("GET", filePath, false);
      xmlhttp.send();
      if (xmlhttp.status==200) {
        result = xmlhttp.responseText;
      }
      return result;
    }

</script>
</html>